/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package MyStatementExecution.MyDelete;

import MyStatementExecution.MyStatement;
import MyStatementExecution.MyStatementKind;
import MyDataContainer.MyTable;
import StringJoinerCutter.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import sun.java2d.opengl.WGLGraphicsConfig;

/**
 *
 * @author Welcome
 */
public class MyDeleteStatement extends MyStatement{

    
    private String whereCondition;
    public MyDeleteStatement() {
        myStatementKind = MyStatementKind.DELETE;
        whereCondition="";
    }
    

    
    @Override
    public MyStatementKind getKind() {
        return this.myStatementKind;
    }

    @Override
    public void executeStatement() {
        try {
            String fromString = StringJoinerCutter.getStringInMidle(statementString, "from", "where");
        
        MyTable tempMyTable;
        for(int i=0; i<databaseHandler.getTables().size();i++)
        {
            tempMyTable = databaseHandler.getTable(fromString);
        }
        
        //where
        whereCondition = StringJoinerCutter.getStringInMidle(statementString, "where", "");
        
        } catch (Exception ex) {
            Logger.getLogger(MyDeleteStatement.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    
}
